package cn.wolfcode.crm.util;

import java.lang.reflect.Method;

public class PermissionUtil {

    //传入controller方法的名字
    public static String handlerExpression(Method method) {
        //获得这个方法的类的名字
        String simpleName = method.getDeclaringClass().getSimpleName();//DepartmentController
        simpleName = simpleName.replace("Controller", "");//Department
        simpleName = simpleName.toLowerCase();//department
        //获得这个方法的名字
        String methodName = method.getName();//list
        String expression = simpleName + ":" + methodName;//department:list
        return expression;
    }
}
